* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    min-height: 100vh;
}

.main-content {
    width: 100%;
    padding-bottom: 120px; /* 给固定定位的 footer 留出空间 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    margin-bottom: 40px;
    font-weight: 600;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.icon {
    font-size: 2.5em;
}

.title {
    font-size: 1.2em;
    font-weight: 500;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* 添加错误信息样式 */
.error {
    background: rgba(255, 0, 0, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin: 20px;
    color: #721c24;
}

.error p {
    margin: 10px 0;
}

.error ul {
    margin: 10px 0;
    padding-left: 20px;
}

.error code {
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.error button {
    background: #007aff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
}

.error button:hover {
    background: #0056b3;
}

/* 搜索框样式 */
.search-box {
    margin: 20px auto;
    max-width: 500px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 20px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

/* 分类按钮样式 */
.categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
}

.category-btn.active {
    background: #007aff;
    color: white;
}

/* 添加网站描述样式 */
.description {
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

/* 添加夜间模式切换按钮 */
.theme-toggle {
    position: fixed;
    right: 20px;
    top: 20px;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* 夜间模式样式 */
body.dark-mode {
    background-color: #1a1a1a;
    color: #f5f5f7;
}

body.dark-mode .card {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .description {
    color: #999;
}

/* 夜间模式补充样式 */
body.dark-mode .search-box input {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .category-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .category-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .category-btn.active {
    background: #007aff;
}

body.dark-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .error {
    background: rgba(255, 0, 0, 0.2);
    color: #ff9999;
}

/* 添加一些过渡效果 */
.card, .category-btn, .search-box input, .theme-toggle {
    transition: all 0.3s ease;
}

/* 页脚样式 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 100;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info {
    font-size: 0.9em;
    color: #666;
}

.footer-info p {
    margin: 5px 0;
}

.footer-info a {
    color: #007aff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-info a:hover {
    color: #0056b3;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #007aff;
    transform: translateY(-2px);
}

.footer-icon {
    font-size: 1.2em;
}

/* 夜间模式页脚样式 */
body.dark-mode .footer {
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .footer-info,
body.dark-mode .footer-links a {
    color: #999;
}

body.dark-mode .footer-info a {
    color: #007aff;
}

body.dark-mode .footer-links a:hover {
    color: #fff;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}